Skip to content

[STACKED on #964] fix(verifier): validate one-shot certificate profile - #938

Merged
kvinwang merged 3 commits into
masterfrom
codex/fix-ra-tls-security-profile
Aug 5, 2026
Merged

[STACKED on #964] fix(verifier): validate one-shot certificate profile#938
kvinwang merged 3 commits into
masterfrom
codex/fix-ra-tls-security-profile

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

STACKED PR — merge #964 first.

Problem

The dstack-verifier --verify-cert one-shot path reads a certificate directly from disk, so it does not pass through rustls/WebPKI certificate validation. Certificates with an invalid self-signature, validity period, key usage, extended key usage, or SAN profile could reach the one-shot attestation trust decision.

Root cause and fix

Validate the required endpoint certificate profile in dstack-verifier before performing RA-TLS attestation and public-key-binding verification.

The profile policy intentionally lives in dstack-verifier, not the ra-tls library: ra-tls remains responsible only for parsing and cryptographically verifying the embedded attestation and its binding to the certificate SPKI. This avoids implying that the reusable library API performs general TLS/WebPKI endpoint validation.

Implementation

  • Validate the self-signed endpoint certificate signature and validity period.
  • Require digital-signature key usage.
  • Require server-auth or client-auth extended key usage.
  • Require a non-empty SAN extension.
  • Normalize PEM input to DER before applying the one-shot policy and RA-TLS verification.
  • Enable x509-parser signature verification only in dstack-verifier.

Changed paths relative to the stacked parent:

  • dstack/Cargo.lock
  • dstack/verifier/Cargo.toml
  • dstack/verifier/src/main.rs

Scope

This PR addresses the certificate-file one-shot path only. Normal TLS connections remain subject to their TLS stack's certificate verification. The reusable ra-tls verification API continues to verify attestation evidence and SPKI binding without imposing an application-specific X.509 profile.

Dependency and merge order

Verification

  • cargo check -p dstack-verifier: passed.
  • cargo test -p ra-tls --lib: passed (13 tests).
  • git diff --check: passed.

Copilot AI review requested due to automatic review settings July 31, 2026 03:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kvinwang
kvinwang force-pushed the codex/fix-ra-tls-security-profile branch from ee8e684 to 6c9626a Compare July 31, 2026 03:32
@kvinwang kvinwang changed the title fix(ra-tls): validate the certificate security profile [STACKED on #964] fix(ra-tls): validate the certificate security profile Jul 31, 2026
@kvinwang
kvinwang changed the base branch from master to codex/feat-simulator-seeded-attestation July 31, 2026 03:32
@kvinwang kvinwang changed the title [STACKED on #964] fix(ra-tls): validate the certificate security profile [STACKED on #964] fix(verifier): validate one-shot certificate profile Aug 5, 2026
Base automatically changed from codex/feat-simulator-seeded-attestation to master August 5, 2026 11:55
@kvinwang
kvinwang force-pushed the codex/fix-ra-tls-security-profile branch from 309de9f to cdda5fa Compare August 5, 2026 11:55
@kvinwang
kvinwang merged commit 50343d6 into master Aug 5, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants